modules: fix default values
authorAndy Chiang <[email protected]>
Mon, 20 Oct 2025 21:18:35 +0000 (04:18 +0700)
committerPaul Donald <[email protected]>
Tue, 21 Oct 2025 14:12:03 +0000 (16:12 +0200)
fix default values for luci-base and luci-mod-{dashboard,status,system}

Signed-off-by: Andy Chiang <[email protected]>
modules/luci-base/htdocs/luci-static/resources/tools/views.js
modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/10_router.js
modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js
modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js

index e223600215f205ab4c6b099ce5081104b5e31427..01cd7556ab9c8123f155995e7c498529c48938e8 100644 (file)
@@ -73,12 +73,12 @@ var CBILogreadBox = function(logtag, name) {
                        try {
                                const tz = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_');
                                const ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0;
-                               const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
+                               const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
                                const logEntries = await callLogRead(this.fetchMaxRows, false, true);
                                const dateObj = new Intl.DateTimeFormat(undefined, {
                                                dateStyle: 'medium',
                                                timeStyle: (ts == 0) ? 'long' : 'full',
-                                               hourCycle: hc,
+                                               hourCycle: (hc == 0) ? undefined : hc,
                                                timeZone: tz
                                });
 
index 2990929cc9920799c01ea0b5ba1497ed846a93e0..6a06edf53101e3c7242a3f6564e5cb68c0020854 100644 (file)
@@ -315,12 +315,12 @@ return baseclass.extend({
                        const date = new Date(unixtime * 1000);
                        const zn = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_') || 'UTC';
                        const ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0;
-                       const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
+                       const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
 
                        datestr = new Intl.DateTimeFormat(undefined, {
                                dateStyle: 'medium',
                                timeStyle: (ts == 0) ? 'long' : 'full',
-                               hourCycle: hc,
+                               hourCycle: (hc == 0) ? undefined : hc,
                                timeZone: zn
                        }).format(date);
                }
index 043051e4626daa9a95d72058be386ecc79a54129..3a2d2f1f2f1060606905daafb2b7e9d2ab213fd0 100644 (file)
@@ -52,12 +52,12 @@ return baseclass.extend({
                        var date = new Date(unixtime * 1000),
                                zn = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_') || 'UTC',
                                ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0,
-                               hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
+                               hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
 
                        datestr = new Intl.DateTimeFormat(undefined, {
                                dateStyle: 'medium',
                                timeStyle: (ts == 0) ? 'long' : 'full',
-                               hourCycle: hc,
+                               hourCycle: (hc == 0) ? undefined : hc,
                                timeZone: zn
                        }).format(date);
                }
index 80ad921e9a7b9c5a4ccacf92cf41b4e8eddb7366..430c67e81bdb5a9fd06abaee74d8759fd116235c 100644 (file)
@@ -52,12 +52,12 @@ function formatTime(epoch) {
        var date = new Date(epoch * 1000),
                zn = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_') || 'UTC',
                ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0,
-               hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
+               hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
 
        return new Intl.DateTimeFormat(undefined, {
                dateStyle: 'medium',
                timeStyle: (ts == 0) ? 'long' : 'full',
-               hourCycle: hc,
+               hourCycle: (hc == 0) ? undefined : hc,
                timeZone: zn
        }).format(date);
 }
@@ -157,7 +157,6 @@ return view.extend({
                };
 
                o = s.taboption('general', form.Flag, 'clock_timestyle', _('Full TimeZone Name'), _('Unchecked means the timezone offset (E.g. GMT+1) is displayed'));
-               o.default = o.enabled;
 
                o = s.taboption('general', form.ListValue, 'clock_hourcycle', _('Time Format'));
                o.value('', _('Default'));